Conversation
Signed-off-by: tison <wander4096@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the combinator API by renaming the or combinator to chain, which better reflects its sequential execution semantics. The or name was potentially confusing as it suggests a logical OR operation, whereas chain more clearly indicates that visitors are executed one after another.
Key changes:
- Renamed
VisitorExt::or()andVisitorMutExt::or()methods tochain() - Renamed
OrVisitorstruct toChainVisitor - Updated documentation and test usages to reflect the new naming
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
traversable/src/combinator.rs |
Renamed combinator methods from or to chain, renamed struct from OrVisitor to ChainVisitor, and updated documentation |
traversable/tests/test_combinator.rs |
Updated test code to use the new chain() method instead of or() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// This struct is created by the [`or`](VisitorExt::or) method on [`VisitorExt`] or | ||
| /// [`VisitorMutExt`]. | ||
| pub struct OrVisitor<V1, V2> { | ||
| /// This struct is created by the `chain` method on [`VisitorExt`] or [`VisitorMutExt`]. |
There was a problem hiding this comment.
The documentation should use a proper doc link for the chain method like [chain](VisitorExt::chain) or [chain] to maintain consistency with the original documentation style and enable proper cross-referencing in generated documentation.
| /// This struct is created by the `chain` method on [`VisitorExt`] or [`VisitorMutExt`]. | |
| /// This struct is created by the [`chain`](VisitorExt::chain) method on [`VisitorExt`] or [`VisitorMutExt`]. |
No description provided.